using System;
using Rogan.Utility.Common;

namespace Rogan.Data
{
	[Serializable]
	public class JoinExpression : IDbExpression, ICloneable<JoinExpression>
	{
		public DbExpressionType ExpressionType
		{
			get
			{
				return DbExpressionType.Join;
			}
		}
		public WhereExpression Where
		{
			get;
			set;
		}
		public Entity Entity
		{
			get;
			set;
		}
		public JoinType JoinType
		{
			get;
			set;
		}
		public JoinExpression(Entity entity, WhereExpression where) : this(entity, where, JoinType.InnerJoin)
		{
		}
		public JoinExpression(Entity entity, WhereExpression where, JoinType jointype)
		{
			Entity = entity;
			Where = where;
			JoinType = jointype;
		}
		public JoinExpression Clone()
		{
			return DataHelper.Clone(this) as JoinExpression;
		}
	}
}
